import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzSwitchModule } from 'ng-zorro-antd/switch';

@Component({
  selector: 'app-switch-loading',
  standalone: true,
  imports: [NzSwitchModule, FormsModule],
  template: `
    <p class="demo demo-space">
      <nz-switch
        [(ngModel)]="loading"
        nzCheckedChildren="加载"
        nzUnCheckedChildren="空闲"
      ></nz-switch>
      <nz-switch [(ngModel)]="value" [nzLoading]="loading"></nz-switch>
      <nz-switch
        [(ngModel)]="value"
        [nzLoading]="loading"
        nzSize="small"
      ></nz-switch>
    </p>
  `,
})
export class SwitchLoadingComponent {
  value = false;
  loading = false;
}
